package com.hq.mapper;

import com.hq.entity.QuestionPo;
import com.hq.entity.Questions;
import com.hq.entity.TQuestion;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface QuestionMapper {

    //查询所有
    List<Questions> findAll();

    //添加试卷
    int addQuestion(
                    @Param("eid") Integer eid,
                    @Param("tid") Integer tid,
                    @Param("questionStem")String questionStem,
                    @Param("options")String options,
                    @Param("answer")String answer
    );


    //单行删除试卷
    int delQuestion(int qid);

    //根据id查询试卷
    QuestionPo findById(Integer qid);

    //修改试卷
    int updateQuestion(QuestionPo question);

    //批量删除试卷
    int delQuestions(String qids);

    //根据tid和eid查询
    List<TQuestion> findByType(@Param("eid") Integer eid, @Param("tid") Integer tid);
}
